import 'package:flutter/material.dart';

class InfoPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    //获取参数的方式
    final int id = ModalRoute.of(context)?.settings.arguments as int;

    return Scaffold(
      appBar: AppBar(title: Text('详情页面')),
      body: Container(
        alignment: Alignment.center,
        color: Colors.orange[100],
        width: double.infinity,
        height: double.infinity,
        child: Text('获取到上一个页面的参数  $id'),
      ),
    );
  }
}
